/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package component;

import processing.core.PApplet;

/**
 *
 * @author biron
 */
public abstract class AButton
{
    int x, y, hw, hh;
    protected PApplet _app;

    AButton(int x, int y, int hw, int hh, PApplet app)
    {
        this.x = x;
        this.y = y;
        this.hw = hw;
        this.hh = hh;
        _app = app;
    }

    boolean pressed()
    {
        return _app.mouseX > x - hw && _app.mouseX < x + hw && _app.mouseY > y - hh && _app.mouseY < y + hh;
    }

    public abstract void mousePressed();
    public abstract void mouseReleased();
    public abstract void update();
    public abstract void draw();
}
